﻿
// won't be needed - check later and delete !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

namespace C11_Ex02_1
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using C11_Ex02_1;

    public class UserIOInterface
    {
        public static void AskUserForName()
        {
            System.Console.Write("Please enter your name : ");
        }

        public static string GetUserName()
        {
            string ReturnValue = null;

            ReturnValue = System.Console.ReadLine();

            return ReturnValue;
        }
        
        public static void AskUserForAmountOfPlayers()
        {
            System.Console.WriteLine("Please enter amount of players in game");
            System.Console.WriteLine("1. For a match against the Computer.");
            System.Console.WriteLine("2. For a match against another human.");
        }

        public static void AnounceErrorOnPlayersAmount()
        {
            System.Console.WriteLine("Error : players amount entered is illegal, please try again :");
        }
        
        public static void AskUserForBoardSize()
        {
            System.Console.WriteLine("Please enter the game board's dimentions, instructions :");
            System.Console.WriteLine("1. Size must be an even number of cards.");
            System.Console.WriteLine("2. Minimum size is 4x4, maximum size is 6x6.");
            System.Console.WriteLine("3. Enter data in the following order - first Lines then Rows amount.");
        }

        public static bool GetBoardDimentionsInput(ref int o_UserLinesAmount, ref int o_UserRowsAmount)
        {
            string LinesInput = null;
            string RowsInput = null;
            bool ReturnValue = true;
            
            LinesInput = System.Console.ReadLine();
            RowsInput = System.Console.ReadLine();

            try
            {
                int.TryParse(LinesInput, out o_UserLinesAmount);
                int.TryParse(RowsInput, out o_UserRowsAmount);
            }
            catch (InvalidCastException)
            {
                o_UserLinesAmount = 0;
                o_UserRowsAmount = 0;
                ReturnValue = false;
            }

            return ReturnValue;
        }

        public static void AnounceErrorOnBoardInput()
        {
            System.Console.WriteLine("Error : the board dimentions input isn't a legal input.");
        }

        public static void AnounceErrorOnBoardDimentions()
        {
            System.Console.WriteLine("Error : the board dimentions that were entered wheren't legal.");
        }
        
        // FINISH CODING HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        public static void ReadCardToReveal(string o_CardToReveal)
        {
            askUserToEnterCellToReveal();
            o_CardToReveal = System.Console.ReadLine();
        }

        private static void askUserToEnterCellToReveal()
        {
            System.Console.Write("Please enter card location to reveal : ");
        }

        protected static bool CheckCellToRevealUserInputLegality(string i_CellToReveal)
        {
            bool returnValue = true;

            return returnValue;
        }

        public static bool AskUserForARematch()
        {

        }
    }
}
